<h1>Listing products</h1>

<table>
    <% @products.each do |product| %>
      <tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
	<td>
		<%= image_tag(product.image_url, class:'list_iamge') %>
	</td>
	<td class="list_description">
		<dl>
			<dt><%= product.title %></dt>
			<dt><%= truncate(strip_tags(product.description), length: 80)%></dt>
		</dl>
	</td>
	<td classs="list_actions">
		<%= link_to 'Show', product %>
		<%= link_to 'Edit', edit_product_path(product) %>
		<%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %>
	</td>
      </tr>
    <% end %>
</table>

<br>

<%= link_to 'New Product', new_product_path %>
